package p270jp.pxv.android.viewholder;

import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import p165fo.C3114c;
import p270jp.pxv.android.R;
import p270jp.pxv.android.event.LoadRelatedIllustEvent;

/* renamed from: jp.pxv.android.viewholder.DetailRelatedLabelViewHolder */
/* loaded from: classes2.dex */
public class DetailRelatedLabelViewHolder extends BaseViewHolder {
    private TextView noRelatedIllustTextView;
    private ProgressBar progressBar;

    /* renamed from: jp.pxv.android.viewholder.DetailRelatedLabelViewHolder$LabelItem */
    /* loaded from: classes2.dex */
    public static class LabelItem {
        private long illustId;
        private boolean loaded;
        private int relatedIllustCount;

        public LabelItem(long j) {
            this.illustId = j;
        }

        public long getIllustId() {
            return this.illustId;
        }

        public int getRelatedIllustCount() {
            return this.relatedIllustCount;
        }

        public boolean isLoaded() {
            return this.loaded;
        }

        public void setLoaded(boolean z) {
            this.loaded = z;
        }

        public void setRelatedIllustCount(int i) {
            this.relatedIllustCount = i;
        }
    }

    public DetailRelatedLabelViewHolder(View view) {
        super(view);
        this.progressBar = (ProgressBar) view.findViewById(R.id.related_illust_progress_bar);
        this.noRelatedIllustTextView = (TextView) view.findViewById(R.id.no_related_illust_text_view);
    }

    public static int getLayoutRes() {
        return R.layout.illust_caption_related_header_item;
    }

    @Override // p270jp.pxv.android.viewholder.BaseViewHolder
    public void bind(Object obj) {
        super.bind(obj);
        LabelItem labelItem = (LabelItem) obj;
        C3114c.m6284b().m6280f(new LoadRelatedIllustEvent(labelItem.getIllustId()));
        if (labelItem.isLoaded()) {
            this.progressBar.setVisibility(8);
            if (labelItem.getRelatedIllustCount() == 0) {
                this.noRelatedIllustTextView.setVisibility(0);
            } else {
                this.noRelatedIllustTextView.setVisibility(8);
            }
        } else {
            C3114c.m6284b().m6280f(new LoadRelatedIllustEvent(labelItem.getIllustId()));
        }
    }
}
